<?php

class Helper_ArrayMap
{
	static function mapGetByKey($array, $key)
	{
		if (!is_array($input) || !is_scalar($key)) return array(); 
		$mapGetKey = array();
		foreach($array as $v)
		{ 
			if (array_key_exists($key, $v))
			{
				$mapGetKey[]=$v[$key];
			} 
		} 
		return $mapGetKey; 
	}
	
	/// @todo D1104 Helper_ArrayMap::mapMerge
	/// @todo D1104 Helper_ArrayMap::mapUnshift, pop, push, etc.
	
	static function mapFlip($array)
	{
		$mapFlip = array();
		foreach ($array as $id => $content)
		{
			foreach ($content as $key => $value)
			{
				$mapFlip[$key][$id] = $content[$key];
			}
		}
		return $mapFlip;
	}
	
	/// @todo D1104 Helper_ArrayMap::mapMerge ? http://www.php.net/manual/en/function.array-map.php#86743
	/// @todo D1104 Helper_ArrayMap::mapGetKeyByContent
	/// @todo D1104 Helper_ArrayMap::flaten
}